package top.techqi.usbd

import android.hardware.usb.UsbDevice
import android.hardware.usb.UsbDeviceConnection
import java.io.Closeable
import java.io.IOException

/**
 * USB设备驱动基类
 *
 * @param device USB设备
 * @param intfId USB接口ID
 */
abstract class UsbDriver(val device: UsbDevice, val intfId: Int) : Closeable {
    @Throws(IOException::class)
    abstract fun open(conn: UsbDeviceConnection)

    protected fun finalize() {
        close()
    }
}
